{{ define "admin/article_edit.html" }}
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>编辑文章</title>
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta name="keywords" content="">
		<meta name="description" content="">
		<link rel="stylesheet" href="/static/layui/css/layui.css">
		<link rel="stylesheet" href="/static/css/global.css">
	</head>
	<body>

		{{template "public/page_header.html" .}}

		<div class="main layui-clear">
			<div class="fly-panel" pad20>
				<h2 class="page-title">编辑博客</h2>

				<!-- <div class="fly-none">并无权限</div> -->

				<div class="layui-form layui-form-pane">
					<form action="/admin/article/doedit" method="post">
						<input type="hidden" name="id"  value="{{.article.id}}"/>
						<div class="layui-form-item">
							<label for="L_title" class="layui-form-label">标题</label>
							<div class="layui-input-block">
								<input type="text" id="L_title" name="title" required lay-verify="required"
									autocomplete="off" class="layui-input" value="{{.article.title}}">
							</div>
						</div>
						<div class="layui-form-item layui-form-text">
							<div class="layui-input-block">
								<textarea id="L_content" name="content" required lay-verify="required"
									placeholder="请输入内容" class="layui-textarea fly-editor"
									style="height: 260px;">{{.article.content}}</textarea>
							</div>
							<label for="L_content" class="layui-form-label" style="top: -2px;">描述</label>
						</div>
						{{$cid := .article.cat}} 
						<div class="layui-form-item">
							<div class="layui-inline">
								<label class="layui-form-label">类别1</label>
								<div class="layui-input-block">
									<select lay-verify="required" name="class">
										<option></option>
										{{range $key,$value := .cat}}
										<option value="{{$value.id}}" {{if eq $cid $value.id}} selected="selected" {{end}}>{{$value.cname}}</option>
										{{end}}
									</select>
								</div>
							</div>
							{{$cid1 := .article.cat1}} 
							<div class="layui-inline">
								<label class="layui-form-label">类别2</label>
								<div class="layui-input-block">
									<select name="class1">
										<option></option>
										{{range $key,$value := .cat}}
										<option value="{{$value.id}}" {{if eq $cid1 $value.id}} selected="selected" {{end}}>{{$value.cname}}</option>
										{{end}}
									</select>
								</div>
							</div>
							{{$cid2 := .article.cat2}} 
							<div class="layui-inline">
								<label class="layui-form-label">类别3</label>
								<div class="layui-input-block">
									<select name="class2">
										<option></option>
										{{range $key,$value := .cat}}
										<option value="{{$value.id}}" {{if eq $cid2 $value.id}} selected="selected" {{end}}>{{$value.cname}}</option>
										{{end}}
									</select>
								</div>
							</div>
							{{$fei := .article.fei}} 	
							<div class="layui-inline">
								<label class="layui-form-label">悬赏飞吻</label>
								<div class="layui-input-block">
									<select name="experience">
										<option value="5" {{if eq $fei "5"}} selected="selected" {{end}}>5</option>
										<option value="20" {{if eq $fei "20"}} selected="selected" {{end}}>20</option>
										<option value="50" {{if eq $fei "50"}} selected="selected" {{end}}>50</option>
										<option value="100" {{if eq $fei "100"}} selected="selected" {{end}}>100</option>
									</select>
								</div>
							</div>
							<div class="layui-inline">
								<div class="layui-form-item">
									<label class="layui-form-label">推荐</label>
									<div class="layui-input-block">
										{{$hot := .article.hot}} 
										<input type="checkbox" name="hot" title="精贴" value="1" {{if eq $hot "1"}} checked="true" {{end}}>
										<div class="layui-unselect layui-form-checkbox"><span>精贴</span><i
												class="layui-icon layui-icon-ok"></i></div>
										{{$top := .article.top}}		
										<input type="checkbox" name="top" title="置顶" value="1" {{if eq $top "1"}} checked="true" {{end}}>
										<div class="layui-unselect layui-form-checkbox"><span>置顶</span><i
												class="layui-icon layui-icon-ok"></i></div>
										 
									</div>
								</div>
							</div>

						</div>

						<div class="layui-form-item">
							<button class="layui-btn" lay-filter="*" lay-submit alert="true">立即发布</button>
						</div>
					</form>
				</div>
			</div>
		</div>
		{{template "public/page_footer.html" .}}

		{{end}}
